﻿@model IEnumerable<MvcCart.Models.Cart>

@{
    ViewData["Title"] = "Index";
}

<h1>Index</h1>

<p>
    <a asp-action="Create">Create New</a>
</p>

<form action="/Carts/Index" method="get">
    商品id：  <input type="text" name="id" />
    商品价格: <input type="text" name="low" style="width:60px" />  <input type="text" name="high" style="width:60px" />
    <input type="submit" value="查询" />
</form>

<table class="table">
    <thead>
        <tr>
            <th>
                @Html.DisplayNameFor(model => model.CommodityId)
            </th>
            <th>
                @Html.DisplayNameFor(model => model.Count)
            </th>
            <th>
                @Html.DisplayNameFor(model => model.CreateDate)
            </th>
            <th>
                @Html.DisplayNameFor(model => model.Price)
            </th>
            <th>
                @Html.DisplayNameFor(model => model.UserId)
            </th>
            <th></th>
        </tr>
    </thead>
    <tbody>
@foreach (var item in Model) {
        <tr>
            <td>
                @Html.DisplayFor(modelItem => item.CommodityId)
            </td>
            <td>
                @Html.DisplayFor(modelItem => item.Count)
            </td>
            <td>
                @Html.DisplayFor(modelItem => item.CreateDate)
            </td>
            <td>
                @Html.DisplayFor(modelItem => item.Price)
            </td>
            <td>
                @Html.DisplayFor(modelItem => item.UserId)
            </td>
            <td>
                <a asp-action="Edit" asp-route-id="@item.CartId">Edit</a> |
                <a asp-action="Details" asp-route-id="@item.CartId">Details</a> |
                <a asp-action="Delete" asp-route-id="@item.CartId">Delete</a>
            </td>
        </tr>
}
    </tbody>
</table>
